<?php

require_once('PHPTAL/PHPTAL/TranslationService.php');

class FP_View_Phptal_ZendTranslator implements PHPTAL_TranslationService {

    private $_currentLang = null;

    public function setLanguage(){
// 	$translater = Zend_Registry::get('Zend_Translate');
//
// 	$langs = func_get_args();
// 	foreach ($langs as $lang){
// 	    if ($translater->isAvailable($lang)){
// 		$this->_currentLang = $lang;
// 		return;
// 	    }
// 	}
	return true;
    }

    public function useDomain($pDomain){
	return true;
    }

    public function setVar($pKey, $pVal){
	return true;
    }

    public function translate($pKey, $htmlescape=true){
	$translator = Zend_Registry::get('Zend_Translate');
// 	logdebug("FP_View_Phptal_ZendTranslator.translate: Translating $pKey");
	return $translator->translate($pKey);
    }

    public function setEncoding($pEncoding){
	return true;
    }
}

?>
